package com.ty.day2;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author : TangYu
 * @create 2023/10/27 9:09
 */
public class First {
    public static void main(String[] args) {
        System.out.print("水仙花数有：");
        for (int i = 100; i < 1000; i++) {
            int x = (int) Math.pow(i % 10, 3);
            int y = (int) Math.pow(i / 100, 3);
            int z = (int) Math.pow(i / 10 % 10, 3);
            if (x + y + z == i) {
                System.out.print(i + " ");
            }
        }
    }
}
